<script lang="ts" setup>
import { ElConfigProvider } from 'element-plus'
import zhCn from 'element-plus/lib/locale/lang/zh-cn'

window.config = {
  isPc: !/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)
}
const locale = zhCn
</script>

<template>
  <el-config-provider :locale="locale">
    <router-view v-slot="{ Component }">
      <!-- 需要使用 include 优化 缓存策略 -->
      <keep-alive>
        <component :is="Component" v-if="$route.meta.keepAlive" :key="$route.path"></component>
      </keep-alive>
      <component :is="Component" v-if="!$route.meta.keepAlive" :key="$route.path"></component>
    </router-view>
  </el-config-provider>
</template>

<style>
body {
  font-family: Avenir, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.5;
  background-image: url("assets/background2.png");
  background-size: 100% 100%;
  background-attachment: fixed;
}
</style>


